package BeheerFysiotherapeuten.View;

import java.awt.event.ActionListener;


public class PraktijkPopup extends javax.swing.JFrame {
	private javax.swing.JTextField adresfield;

	private javax.swing.JLabel jLabel1;
	private javax.swing.JLabel jLabel2;
	private javax.swing.JLabel jLabel3;
	private javax.swing.JLabel jLabel4;
	private javax.swing.JLabel jLabel5;
	private javax.swing.JTextField naamfield;
	private javax.swing.JButton nieuwopslaan;
	private javax.swing.JButton nieuwannuleer;
	private javax.swing.JButton wijzigopslaan;
	private javax.swing.JButton wijzigannuleer;
	private javax.swing.JButton verwijderja;
	private javax.swing.JButton verwijdernee;
	private javax.swing.JTextField postcodefield;
	private javax.swing.JTextField telnrfield;
	private javax.swing.JTextField kamers;
	private javax.swing.JLabel Error;
	private javax.swing.JLabel praktijknaam;


	public PraktijkPopup(String welke) {

		if (welke == "Nieuw") {
			initComponentsniew();

		} else if (welke == "Wijzig") {
			initComponentswijzigen();

		} else if (welke == "Verwijder") {
			initComponentsverwijder();

		}

	}

	private void initComponentsniew() {

		jLabel1 = new javax.swing.JLabel();
		naamfield = new javax.swing.JTextField();
		adresfield = new javax.swing.JTextField();
		postcodefield = new javax.swing.JTextField();
		telnrfield = new javax.swing.JTextField();
		kamers = new javax.swing.JTextField();
		jLabel2 = new javax.swing.JLabel();
		jLabel3 = new javax.swing.JLabel();
		jLabel4 = new javax.swing.JLabel();
		jLabel5 = new javax.swing.JLabel();
		Error = new javax.swing.JLabel();
		nieuwopslaan = new javax.swing.JButton();
		nieuwannuleer = new javax.swing.JButton();

		setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);

		jLabel1.setText("Praktijknaam");
		Error.setText("");
		jLabel2.setText("Adres");

		jLabel3.setText("Postcode");

		jLabel4.setText("telefoonNr");
		jLabel5.setText("aantal Kamers");

		nieuwopslaan.setText("Opslaan");
		nieuwopslaan.setActionCommand("nieuwopslaan");
		nieuwannuleer.setText("Annuleren");
		nieuwannuleer.setActionCommand("nieuwannuleer");
		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
				getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addContainerGap()
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.LEADING,
												false)
												.addGroup(
														layout.createSequentialGroup()
																.addGroup(
																		layout.createParallelGroup(
																				javax.swing.GroupLayout.Alignment.LEADING,
																				false)
																				.addComponent(
																						jLabel4,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						Short.MAX_VALUE)
																				.addComponent(
																						jLabel5,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						Short.MAX_VALUE)
																				.addComponent(
																						jLabel1)
																				.addComponent(
																						Error)
																				.addComponent(
																						jLabel2,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						69,
																						Short.MAX_VALUE)
																				.addComponent(
																						jLabel3,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						Short.MAX_VALUE))
																.addPreferredGap(
																		javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
																.addGroup(
																		layout.createParallelGroup(
																				javax.swing.GroupLayout.Alignment.TRAILING,
																				false)
																				.addComponent(
																						telnrfield,
																						javax.swing.GroupLayout.Alignment.LEADING)
																				.addComponent(
																						postcodefield,
																						javax.swing.GroupLayout.Alignment.LEADING)
																				.addComponent(
																						adresfield,
																						javax.swing.GroupLayout.Alignment.LEADING)
																				.addComponent(
																						kamers,
																						javax.swing.GroupLayout.Alignment.LEADING)
																				.addComponent(
																						naamfield,
																						javax.swing.GroupLayout.Alignment.LEADING,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						135,
																						Short.MAX_VALUE)))
												.addGroup(
														javax.swing.GroupLayout.Alignment.TRAILING,
														layout.createSequentialGroup()
																.addComponent(
																		nieuwopslaan,
																		javax.swing.GroupLayout.PREFERRED_SIZE,
																		87,
																		javax.swing.GroupLayout.PREFERRED_SIZE)
																.addPreferredGap(
																		javax.swing.LayoutStyle.ComponentPlacement.RELATED,
																		javax.swing.GroupLayout.DEFAULT_SIZE,
																		Short.MAX_VALUE)
																.addComponent(
																		nieuwannuleer,
																		javax.swing.GroupLayout.PREFERRED_SIZE,
																		97,
																		javax.swing.GroupLayout.PREFERRED_SIZE)))
								.addContainerGap(18, Short.MAX_VALUE)));
		layout.setVerticalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addContainerGap()
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.BASELINE)
												.addComponent(jLabel1)
												.addComponent(
														naamfield,
														javax.swing.GroupLayout.PREFERRED_SIZE,
														javax.swing.GroupLayout.DEFAULT_SIZE,
														javax.swing.GroupLayout.PREFERRED_SIZE))
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.RELATED)
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.BASELINE)
												.addComponent(
														adresfield,
														javax.swing.GroupLayout.PREFERRED_SIZE,
														javax.swing.GroupLayout.DEFAULT_SIZE,
														javax.swing.GroupLayout.PREFERRED_SIZE)
												.addComponent(jLabel2))

								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.RELATED)
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.BASELINE)
												.addComponent(
														kamers,
														javax.swing.GroupLayout.PREFERRED_SIZE,
														javax.swing.GroupLayout.DEFAULT_SIZE,
														javax.swing.GroupLayout.PREFERRED_SIZE)
												.addComponent(jLabel5))

								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.RELATED)
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.BASELINE)
												.addComponent(
														postcodefield,
														javax.swing.GroupLayout.PREFERRED_SIZE,
														javax.swing.GroupLayout.DEFAULT_SIZE,
														javax.swing.GroupLayout.PREFERRED_SIZE)
												.addComponent(jLabel3))
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.RELATED)
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.BASELINE)
												.addComponent(
														telnrfield,
														javax.swing.GroupLayout.PREFERRED_SIZE,
														javax.swing.GroupLayout.DEFAULT_SIZE,
														javax.swing.GroupLayout.PREFERRED_SIZE)
												.addComponent(jLabel4))
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.RELATED)
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.BASELINE)
												.addComponent(Error))
								.addGap(18, 18, 18)
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.LEADING)
												.addComponent(nieuwopslaan)
												.addComponent(nieuwannuleer))
								.addContainerGap(21, Short.MAX_VALUE)));

		pack();
	}

	private void initComponentswijzigen() {

		jLabel1 = new javax.swing.JLabel();
		naamfield = new javax.swing.JTextField();
		adresfield = new javax.swing.JTextField();
		postcodefield = new javax.swing.JTextField();
		telnrfield = new javax.swing.JTextField();
		jLabel2 = new javax.swing.JLabel();
		jLabel3 = new javax.swing.JLabel();
		jLabel4 = new javax.swing.JLabel();
		wijzigopslaan = new javax.swing.JButton();
		wijzigannuleer = new javax.swing.JButton();
		kamers = new javax.swing.JTextField();
		jLabel5 = new javax.swing.JLabel();
		setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);

		jLabel1.setText("Praktijknaam");

		jLabel2.setText("Adres");

		jLabel3.setText("Postcode");

		jLabel4.setText("telefoonNr");
		jLabel5.setText("aantal Kamers");

		wijzigopslaan.setText("Wijzigen");
		wijzigopslaan.setActionCommand("wijzigopslaan");
		wijzigannuleer.setText("Annuleren");
		wijzigannuleer.setActionCommand("wijzigannuleer");

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
				getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addContainerGap()
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.LEADING,
												false)
												.addGroup(
														layout.createSequentialGroup()
																.addGroup(
																		layout.createParallelGroup(
																				javax.swing.GroupLayout.Alignment.LEADING,
																				false)
																				.addComponent(
																						jLabel4,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						Short.MAX_VALUE)
																				.addComponent(
																						jLabel5,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						Short.MAX_VALUE)
																				.addComponent(
																						jLabel1)
																				.addComponent(
																						jLabel2,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						69,
																						Short.MAX_VALUE)
																				.addComponent(
																						jLabel3,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						Short.MAX_VALUE))
																.addPreferredGap(
																		javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
																.addGroup(
																		layout.createParallelGroup(
																				javax.swing.GroupLayout.Alignment.TRAILING,
																				false)
																				.addComponent(
																						telnrfield,
																						javax.swing.GroupLayout.Alignment.LEADING)
																				.addComponent(
																						postcodefield,
																						javax.swing.GroupLayout.Alignment.LEADING)
																				.addComponent(
																						adresfield,
																						javax.swing.GroupLayout.Alignment.LEADING)
																				.addComponent(
																						kamers,
																						javax.swing.GroupLayout.Alignment.LEADING)
																				.addComponent(
																						naamfield,
																						javax.swing.GroupLayout.Alignment.LEADING,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						135,
																						Short.MAX_VALUE)))
												.addGroup(
														javax.swing.GroupLayout.Alignment.TRAILING,
														layout.createSequentialGroup()
																.addComponent(
																		wijzigopslaan,
																		javax.swing.GroupLayout.PREFERRED_SIZE,
																		87,
																		javax.swing.GroupLayout.PREFERRED_SIZE)
																.addPreferredGap(
																		javax.swing.LayoutStyle.ComponentPlacement.RELATED,
																		javax.swing.GroupLayout.DEFAULT_SIZE,
																		Short.MAX_VALUE)
																.addComponent(
																		wijzigannuleer,
																		javax.swing.GroupLayout.PREFERRED_SIZE,
																		97,
																		javax.swing.GroupLayout.PREFERRED_SIZE)))
								.addContainerGap(18, Short.MAX_VALUE)));
		layout.setVerticalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addContainerGap()
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.BASELINE)
												.addComponent(jLabel1)
												.addComponent(
														naamfield,
														javax.swing.GroupLayout.PREFERRED_SIZE,
														javax.swing.GroupLayout.DEFAULT_SIZE,
														javax.swing.GroupLayout.PREFERRED_SIZE))
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.RELATED)
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.BASELINE)
												.addComponent(
														adresfield,
														javax.swing.GroupLayout.PREFERRED_SIZE,
														javax.swing.GroupLayout.DEFAULT_SIZE,
														javax.swing.GroupLayout.PREFERRED_SIZE)
												.addComponent(jLabel2))
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.RELATED)
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.BASELINE)
												.addComponent(
														kamers,
														javax.swing.GroupLayout.PREFERRED_SIZE,
														javax.swing.GroupLayout.DEFAULT_SIZE,
														javax.swing.GroupLayout.PREFERRED_SIZE)
												.addComponent(jLabel5))

								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.RELATED)
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.BASELINE)
												.addComponent(
														postcodefield,
														javax.swing.GroupLayout.PREFERRED_SIZE,
														javax.swing.GroupLayout.DEFAULT_SIZE,
														javax.swing.GroupLayout.PREFERRED_SIZE)
												.addComponent(jLabel3))
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.RELATED)
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.BASELINE)
												.addComponent(
														telnrfield,
														javax.swing.GroupLayout.PREFERRED_SIZE,
														javax.swing.GroupLayout.DEFAULT_SIZE,
														javax.swing.GroupLayout.PREFERRED_SIZE)
												.addComponent(jLabel4))
								.addGap(18, 18, 18)
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.LEADING)
												.addComponent(wijzigopslaan)
												.addComponent(wijzigannuleer))
								.addContainerGap(21, Short.MAX_VALUE)));

		pack();
	}

	private void initComponentsverwijder() {

		verwijderja = new javax.swing.JButton();
		jLabel1 = new javax.swing.JLabel();
		verwijdernee = new javax.swing.JButton();
		praktijknaam = new javax.swing.JLabel();

		setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);

		verwijderja.setText("Ja");
		verwijderja.setActionCommand("verwijderja");
		jLabel1.setText("Weet u zeker dat u deze praktijk wilt verwijderen?");

		verwijdernee.setText("annuleer");
		verwijdernee.setActionCommand("verwijdernee");
		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
				getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.LEADING)
												.addGroup(
														layout.createSequentialGroup()
																.addContainerGap()
																.addGroup(
																		layout.createParallelGroup(
																				javax.swing.GroupLayout.Alignment.LEADING)
																				.addComponent(
																						jLabel1)
																				.addGroup(
																						layout.createSequentialGroup()
																								.addComponent(
																										verwijderja,
																										javax.swing.GroupLayout.PREFERRED_SIZE,
																										82,
																										javax.swing.GroupLayout.PREFERRED_SIZE)
																								.addPreferredGap(
																										javax.swing.LayoutStyle.ComponentPlacement.RELATED,
																										83,
																										Short.MAX_VALUE)
																								.addComponent(
																										verwijdernee))))
												.addGroup(
														layout.createSequentialGroup()
																.addGap(57, 57,
																		57)
																.addComponent(
																		praktijknaam,
																		javax.swing.GroupLayout.PREFERRED_SIZE,
																		134,
																		javax.swing.GroupLayout.PREFERRED_SIZE)))
								.addContainerGap()));
		layout.setVerticalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addContainerGap()
								.addComponent(praktijknaam,
										javax.swing.GroupLayout.PREFERRED_SIZE,
										17,
										javax.swing.GroupLayout.PREFERRED_SIZE)
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.RELATED)
								.addComponent(jLabel1)
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.BASELINE)
												.addComponent(verwijderja)
												.addComponent(verwijdernee))
								.addContainerGap(25, Short.MAX_VALUE)));

		pack();
	}

	public void nieuwSetListener(ActionListener listener) {
		nieuwopslaan.addActionListener(listener);
		nieuwannuleer.addActionListener(listener);
	}

	public void wijzigSetListener(ActionListener listener) {
		wijzigopslaan.addActionListener(listener);
		wijzigannuleer.addActionListener(listener);
	}

	public void verwijderSetListener(ActionListener listener) {
		verwijderja.addActionListener(listener);
		verwijdernee.addActionListener(listener);
	}

	public String getPraktijknaam() {
		return praktijknaam.getText();
	}

	public void setPraktijknaam(String praktijknaam) {
		
		this.praktijknaam.setText(praktijknaam);
	}

	public String getAdresfield() {
		return adresfield.getText();
	}

	public void setAdresfield(String adresfield) {
		this.adresfield.setText(adresfield);
	}

	public String getKamers() {
		return kamers.getText();
	}

	public void setKamers(String kamers) {
		this.kamers.setText(kamers);
	}

	public String getNaamfield() {
		return naamfield.getText();
	}

	public void setNaamfield(String naamfield) {
		this.naamfield.setText(naamfield);
	}

	public String getPostcodefield() {
		return postcodefield.getText();
	}

	public void setPostcodefield(String postcodefield) {
		this.postcodefield.setText(postcodefield);
	}

	public String getTelnrfield() {
		return telnrfield.getText();
	}

	public void setTelnrfield(String telnrfield) {
		this.telnrfield.setText(telnrfield);
	}

}
